package com.robot.orders.controller;

import com.alibaba.fastjson.JSON;
import com.robot.orders.pojo.SettlementDetails;
import com.robot.orders.service.SettlementDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * settlementDetails控制器层
 *
 * @author wuyunbin
 */
@RestController
@CrossOrigin
@RequestMapping("/settlementDetails")
public class SettlementDetailsJsonController {
    @Autowired
    private SettlementDetailsService settlementDetailsService;

    /**
     * 增加结算明细
     *
     * @param settlementDetails
     * @return
     */
    @PostMapping(value = "third/addSettlementDetails", produces = "application/json; charset=utf-8")
    public void thirdAddSettlementDetails(@RequestBody String settlementDetails) {
        settlementDetailsService.add(JSON.parseObject(settlementDetails, SettlementDetails.class));
    }
}
